package view;

import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
import javafx.scene.paint.Color;
import javafx.stage.StageStyle;

import java.io.IOException;

public class GMItemView extends Window {

    private AnchorPane pane;

    private String name;
    private String portrait;

    public GMItemView(String name, String portrait) throws IOException {
        root = FXMLLoader.load(getClass().getClassLoader().getResource("gmitem.fxml"));
        Scene scene = new Scene(root, 125, 33);
        scene.setFill(Color.TRANSPARENT);
        setScene(scene);
        initStyle(StageStyle.TRANSPARENT);
        setResizable(false);
        setTitle("groupMemberItem");

        this.name = name;
        this.portrait = portrait;

        ((ImageView)findViewById("img")).setStyle("-fx-image: url(" + portrait + ");");
        ((Label)findViewById("name")).setText(name);

        pane = (AnchorPane) findViewById("rootPane");
    }

    public AnchorPane getPane() {
        return pane;
    }

    public String getName() {
        return name;
    }

    public String getPortrait() {
        return portrait;
    }

    @Override
    public void quit() {

    }

    @Override
    public void minimize() {

    }
}
